const path = require('path');
console.log(__dirname);
console.log(__filename);
// 命令行在其中运行的目录
console.log(process.cwd());
// 不是 src ？
console.log(path.resolve('./'));
console.log(path.normalize('/usr/bin//local/desktop'));
// path.join('/a', null);
console.log(path.parse(__filename));
console.log(path.parse(__dirname));
console.log(`basename: ${path.basename(__dirname)}`);
console.log(`basename: ${path.basename('/a/d/b/')}`);
console.log(path.basename('test/haha/test.js', '.js'));  //test
console.log('extname: '+path.extname('test/haha/test.js?__inline'));  //.js
console.log('extname: '+path.extname('index.index'));
console.log(path.dirname('test/haha/test.js'))
console.log('dirname: '+path.dirname(__dirname+path.sep));
console.log('dirname: '+path.dirname(__filename));
console.log(`normalize: ${path.normalize('./')}`);
console.log(`normalize: ${path.normalize('')}`)